<template>
	<view class="page-fade-in" :style="{opacity: pageOpc}">
		<template v-if="pageOpc">
			<view class="content">
				<view class="date">{{operatingInfo.time}}</view>
				<view class="balance-box flexWrap">
					<view class="balance-left flexWarpColumn">
						<view class="balance">{{operatingInfo.tatal_income||'0.00'}}</view>
						<view>总收入</view>
					</view>
					<view class="balance-image">
						<image src="/static/index/goldcoin.png"></image>
					</view>
				</view>
				<view class="shop-info-box" v-if="!store_type">
					<view class="info-item flexWrap">
						<view>已结账订单数量</view>
						<view>{{operatingInfo.order_count||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap" @tap="in_coming==2?goPage('/pages/manage/calculationRecords'):false">
						<view class="flexWrapNo">{{in_coming==2?'结算金额':'可提现金额'}} <view class="look flexWrapNo" v-if="in_coming==2">查看结算记录 <uni-icons type="right" color="#5FD4FF"></uni-icons> </view></view>
						<view>¥ {{operatingInfo.cashout_amount||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>充值收入</view>
						<view>¥ {{operatingInfo.recharge_money||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>助教收入</view>
						<view>¥ {{operatingInfo.assistant_amount||'0.00'}}</view>
					</view>
					<!-- <view class="info-item flexWrap">
						<view>优惠券扣除</view>
						<view>¥ {{operatingInfo.yhjqk||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>余额扣除</view>
						<view>¥ {{operatingInfo.ye_sum||'0.00'}}</view>
					</view> -->
					<view class="info-item flexWrap">
						<view>订单收入</view>
						<view>¥ {{operatingInfo. order_online_amount||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>美团收入</view>
						<view>¥ {{operatingInfo.tuan_amount||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>抖音收入</view>
						<view>¥ {{operatingInfo.douyin_amount||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>美团手续费</view>
						<view>¥ {{operatingInfo.meituan_fee||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>抖音手续费</view>
						<view>¥ {{operatingInfo.douyin_fee||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>通卡收入</view>
						<view>¥ {{operatingInfo.card_amount||'0.00'}}</view>
					</view>
					<!-- <view class="info-item flexWrap">
						<view>小程序退款</view>
						<view>¥ {{operatingInfo.refund_money||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>美团退款</view>
						<view>¥ {{operatingInfo.refund_money||'0.00'}}</view>
					</view> -->
					<view class="info-item flexWrap">
						<view>系统服务费</view>
						<view>¥ {{operatingInfo.platform_commission||'0.00'}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>银行手续费</view>
						<view>¥ {{operatingInfo.bank_amount||'0.00'}}</view>
					</view>
				</view>
				<view class="profit-box-new" v-else>
					<view class="profit-top flexWrap">
						<view class="profit-item flexWarpCenterColumn">
							<view>{{operatingInfo.order_count||'0.00'}}</view>
							<view class="profit-text">已结算订单数</view>
						</view>
						<view class="profit-item flexWarpCenterColumn">
							<view>{{operatingInfo.cashout_amount||'0.00'}}</view>
							<view class="profit-text">已结算金额</view>
						</view>
					</view>
					<view class="profit-cont">
						<view class="profit-title-box flexWrap">
							<view>小程序收入</view>
							<view>{{operatingInfo.program_income}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>微信支付平台</view>
							<view>{{operatingInfo.order_online_amount||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>门店卡充值</view>
							<view>{{operatingInfo.recharge_money||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>通卡抵扣开台</view>
							<view>{{operatingInfo.card_amount||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>助教订单</view>
							<view>{{operatingInfo.assistant_amount||'0.00'}}</view>
						</view>
						<view class="line"></view>
						<view class="profit-item flexWrap">
							<view>小程序退款</view>
							<view>{{operatingInfo.refund_money||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>小程序系统服务费</view>
							<view>{{operatingInfo.program_platform_commission||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>银行手续费</view>
							<view>{{operatingInfo.bank_amount||'0.00'}}</view>
						</view>
					</view>
					<view class="profit-cont">
						<view class="profit-title-box flexWrap">
							<view>团单收入</view>
							<view>{{(Number(operatingInfo.tuan_amount)+Number(operatingInfo.douyin_amount)).toFixed(2)||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>美团核销</view>
							<view>{{operatingInfo.tuan_amount||'0.00'}}</view>
						</view>
						<view class="profit-item flexWrap">
							<view>抖音核销</view>
							<view>{{operatingInfo.douyin_amount||'0.00'}}</view>
						</view>
						<view class="line"></view>
						<view class="profit-item flexWrap">
							<view>团单系统服务费</view>
							<view>{{operatingInfo.day_platform_commission||'0.00'}}</view>
						</view>
					</view>
					<view class="profit-cont">
						<view class="profit-title-box flexWrap">
							<view>补扣团单系统服务费</view>
							<view class="profit-title-right flexWarpColumn" @tap="goPage('/page-home/deductionList?starTime='+operatingInfo.time+'&endTime='+operatingInfo.time)">
								{{operatingInfo.entry_platform_commission||'0.00'}}
								<text class="look" v-if="operatingData.entry_platform_commission">查看明细</text>
							</view>
						</view>
						<view class="profit-item flexWrap" v-for="(item,index) in day_platform_commission_list" :key="index">
							<view>{{item.report_date}}</view>
							<view>{{item.money}}</view>
						</view>
					</view>
				</view>
				<h-watermark :title="watermarkTitle" :mobile="watermarkMobile" :appNameShow="false"></h-watermark>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			const watermarkTitle=uni.getStorageSync('username')
			const watermarkMobile=uni.getStorageSync('mobile')
			return {
				pageOpc:0,
				operatingInfo:{},
				watermarkTitle:watermarkTitle,
				watermarkMobile:watermarkMobile,
				store_type:false,
				day_platform_commission_list:[]
			}
		},
		onLoad() {
			this.operatingInfo=uni.getStorageSync('operatingInfo')
			this.store_type=this.operatingInfo.store_type
			this.day_platform_commission_list=this.operatingInfo.day_platform_commission_list
			console.log(this.operatingInfo)
		},
		onReady(){
			setTimeout(() => {
				this.pageOpc=1
			}, 100)
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.content{
		padding:36upx;
	}
	.date{
		font-size: 32upx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 60upx;
		color: #FFFFFF;
		text-align: center;
		margin: 30upx auto;
	}
	.balance-box{
		.balance-left{
			width: 382upx;
			height: 140upx;
			background: linear-gradient(90deg, #1D1C5C 0%, rgba(29,28,92,0) 100%);
			border-radius: 16upx;
			font-size: 24upx;
			font-family: PingFang SC;
			font-weight: 400;
			line-height: 34upx;
			color: #5FD4FF;
			justify-content: center;
			padding-left: 40upx;
			.balance{
				font-size: 48upx;
				font-family: PingFang SC;
				font-weight: 500;
				line-height: 66upx;
				color: #5FD4FF;
			}
		}
		.balance-image{
			width: 180upx;
			height: 180upx;
			flex:none;
		}
	}
	.shop-info-box{
		margin-top: 30upx;
		border-top: 1upx solid #36355E;
		.info-item{
			font-size: 28upx;
			font-family: PingFang SC;
			font-weight: 400;
			line-height: 40upx;
			color: #FFFFFF;
			padding: 30upx 0;
			border-bottom: 1upx solid #36355E;
			.look{
				font-size: 24upx;
				font-family: PingFang SC;
				font-weight: 500;
				line-height: 40upx;
				color: #5FD4FF;
				text-align: center;
				margin-left: 30upx;
			}
		}
	}
	.profit-box-new{
		.describe-box{
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: rgba(255,255,255,0.5);
			line-height: 33rpx;
			justify-content: flex-end;
			.describe-icon{
				width: 32upx;
				height: 32upx;
				margin-right: 6upx;
			}
		}
		.profit-top{
			margin-top: 20upx;
			.profit-item{
				width:49%;
				height: 128rpx;
				background: #1D1C5C;
				border-radius: 12rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 800;
				font-size: 40rpx;
				color: #FFFFFF;
				line-height: 47rpx;
				justify-content: center;
				.profit-text{
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: rgba(255,255,255,0.5);
					line-height: 28rpx;
					text-align: center;
					font-style: normal;
					text-transform: none;
					margin-top: 10upx;
				}
			}
		}
		.profit-cont{
			background: #1D1C5C;
			border-radius: 12rpx;
			padding: 28upx;
			margin-top: 14upx;
			.profit-title-box{
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: #26BCFD;
				line-height: 38rpx;
				font-style: normal;
				text-transform: none;
				margin-bottom: 24upx;
				align-items: baseline;
				.profit-title-right{
					align-items: flex-end;
					.look{
						font-size: 24upx;
					}
				}
			}
			.profit-item{
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 26rpx;
				color: rgba(255,255,255,0.8);
				line-height: 50rpx;
			}
			.line{
				width: 100%;
				height: 1rpx;
				background: rgba(255,255,255,0.1);
				margin: 10upx 0;
			}
		}
		.profit-month{
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #FFFFFF;
			line-height: 38rpx;
			padding: 38upx 28upx;
			background: #1D1C5C;
			border-radius: 12rpx;
			margin-top: 14upx;
		}
	}
</style>
